home *** CD-ROM | disk | FTP | other *** search
- /**
- GRAB Graph Layout and Browser System
-
- Copyright (c) 1989, Tera Computer Company
- **/
-
- // attribute.c -- routines to manipulate built-in attributes
-
- #include "att.h"
-
- // The following routines provide a 'successor' and 'predecessor' function
- // for shapes, colors, and brushes. The functions are defined so they
- // wraparound, for example, the successor to the last shape is defined
- // to be the first shape, and the predecessor of the first shape is the
- // last shape. This makes it convenient to cycle a node/edge through
- // the various values for these attributes, and to cycle the buttons
- // for the built-in attributes through their various values
-
- NShape NextShape(NShape s)
- {
- if (s != numshape - 2)
- {
- return s + 1;
- }
- else
- {
- return rectangle;
- }
- }
-
- CType NextColor(CType c)
- {
- if (c != numcolor - 1)
- {
- return c + 1;
- }
- else
- {
- return blackc;
- }
- }
-
- BType NextBrush(BType b)
- {
- if (b != numbrush - 1)
- {
- return b + 1;
- }
- else
- {
- return solidb;
- }
- }
-
- NShape PrevShape(NShape s)
- {
- if (s != rectangle)
- {
- return s - 1;
- }
- else
- {
- return numshape - 2;
- }
- }
-
- CType PrevColor(CType c)
- {
- if (c != blackc)
- {
- return c - 1;
- }
- else
- {
- return numcolor - 1;
- }
- }
-
- BType PrevBrush(BType b)
- {
- if (b != solidb)
- {
- return b - 1;
- }
- else
- {
- return numbrush - 1;
- }
- }
-